//메인 메뉴 관련 java script 정의

$(document).ready(function(){
	$.mainOn();
	$.ajax({
		type : "POST",
		url : "kimchi.do",
		data : "command=operationInfo",
		dataType:"json",
		success:function(jsonData){
			var v1=jsonData.map.세척;
			var v2=jsonData.map.절이기;
			var v3=jsonData.map.속넣기;
			var v4=jsonData.map.포장;
			if(v1==="G"){
				$("#working1img").attr({src:""});
			}
			if(v2==="G"){
				$("#working2img").attr({src:""});
			}
			if(v3==="G"){
				$("#working3img").attr({src:""});
			}
			if(v4==="G"){
				$("#working4img").attr({src:""});
			}
			if(v1==="Y"){
				$("#working1img").attr({src:"image.factory/y1.jpg"});
			}
			if(v2==="Y"){
				$("#working2img").attr({src:"image.factory/y2.jpg"});
			}
			if(v3==="Y"){
				$("#working3img").attr({src:"image.factory/y3.jpg"});
			}
			if(v4==="Y"){
				$("#working4img").attr({src:"image.factory/y4.jpg"});
			}
			if(v1==="R"){
				$("#working1img").attr({src:"image.factory/r1.jpg"});
			}
			if(v2==="R"){
				$("#working2img").attr({src:"image.factory/r2.jpg"});
			}
			if(v3==="R"){
				$("#working3img").attr({src:"image.factory/r3.jpg"});
			}
			if(v4==="R"){
				$("#working4img").attr({src:"image.factory/r4.jpg"});
			}
		}
	});
	$("#logoutText").click(function(){
		var a=confirm("로그아웃 하시겠습니까?");
		if(a){
			location.href="index.jsp";
		};
	});
});